
$(document).ready(function(){
	var id=getvl("id");
	var type=getvl("type");
	if(id!=null && id!=""){
	getGoodsOrderDetail(id,type);
	}

});

function getGoodsOrderDetail(id,type){
	  $.ajax({  
        type : "GET",  
        url : urlcore + "/api/orderGoods/orderGoodsDetails?orderGoodsId="+id+"&type="+type, 
        dataType : "json",
        headers:{"Content-Type":"application/json;charset=UTF-8"},
        data : {},
        success: function(data) {//data是返回的hash,key之类的值，key是定义的文件名 
        	var da=data.data;
        	if(data.success==true){
        		var goodsType="";
        	goodsType=da.goodsType==1?"骑手商城":"商家商城";
        	var address=da.province+da.city+da.county+da.addressDetail;
            $("#title").val(da.title);
            $("#eachtype .opts").find("option[value='"+da.goodsType+"']").attr("selected",true);
        	$("#marketPrice").val(da.marketPrice);
            $("#realName").val(da.realName);
            $("#phone").val(da.phone);
           $("#address").val(address);
        	/*$('#province .selected').html(da.province);
        	$("#province .opts").find("option[text='"+da.province+"']").attr("selected",true);
        	$('#city .selected').html(da.city);
        	$("#city .opts").find("option[text='"+da.city+"']").attr("selected",true);
        	$('#area .selected').html(da.county);
    		$("#province).find("option[text='"+da.province+"']").attr("selected",true);
    		$("#city").find("option[text='"+da.city+"']").attr("selected",true);
    		$("#area").find("option[text='"+da.county+"']").attr("selected",true);*/
        	}else {
                alert(data.msg);
            }
        },
        error:function(){  
            alert("失败");  
        }  
    });
	
}

//返回上一页
function back(){
	window.history.back();
}







